--灵活伪装
local linghuoweizhuang = fk.CreateSkill {
    name = "mcdh_linghuoweizhuang",
    tags ={Skill.Compulsory}
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

linghuoweizhuang:addEffect(fk.AfterCardsMove,{
    can_trigger = function(self, event, target, player, data)
        if not player:hasSkill(self) then return false end
        if not player:isKongcheng() then return false end
        for _, move in ipairs(data) do
            if move.from == player.id then
                for _, info in ipairs(move.moveInfo) do
                    if info.fromArea == Card.PlayerHand then
                        return true
                    end
                end
            end
        end
    end,
    on_use = function(self, event, target, player, data)
        player.room:setPlayerMark(player, "@@mcdh__linghuoweizhuang-round", 1)
        player:drawCards(3, self.name)
    end,
})

linghuoweizhuang:addEffect('invalidity',{
    invalidity_func = function(self, from, skill)
        return from:getMark("@@mcdh__linghuoweizhuang-round") > 0 and not skill.attached_equip and not skill.name:endsWith("&")
    end
})

Fk:loadTranslationTable {
    ["mcdh_linghuoweizhuang"] = "灵活伪装",
    [":mcdh_linghuoweizhuang"] = "锁定技，当你失去最后的手牌后，你的所有技能于本轮内失效，你摸三张牌。",
    ["@@mcdh__linghuoweizhuang-round"] = "技能失效"
}

return linghuoweizhuang